home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2003 December / The Sunday Times - The Month 2003-12.iso / mac / The Month DEC 03 / engine / modules / thumbs_kids.swf / scripts / frame_1 / DoAction.as
Text File  |  2003-09-19  |  3KB  |  116 lines

  1. function loadImage(mc, node, extrapath)
  2. {
  3.    var _loc3_ = extrapath;
  4.    _loc3_ != null ? 0 : (_loc3_ = "");
  5.    var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
  6.    var _loc1_ = node.getText();
  7.    var _loc2_ = node.attributes.path;
  8.    if(_loc2_ != null)
  9.    {
  10.       _loc1_ = _loc2_ + _loc1_;
  11.    }
  12.    else
  13.    {
  14.       _loc1_ = strDefaultPath + _loc3_ + _loc1_;
  15.    }
  16.    strPathPrefix != null ? 0 : (strPathPrefix = "");
  17.    mc.loadMovie(strPathPrefix + _loc1_);
  18. }
  19. function addLink(mc)
  20. {
  21.    Links[mc.link] = mc;
  22. }
  23. function getMCfromLink(Item)
  24. {
  25.    var _loc1_ = Item;
  26.    if(Links[_loc1_] == null)
  27.    {
  28.       var _loc2_ = [];
  29.       while(_loc1_ != sideMenu.ItemHome)
  30.       {
  31.          _loc2_.unshift(_loc1_._name.split("_").pop());
  32.          _loc1_ = _loc1_._parent._parent;
  33.       }
  34.       var _loc3_ = _loc2_.join("/");
  35.       Links[_loc1_] = Links[_loc3_];
  36.    }
  37.    return Links[_loc1_];
  38. }
  39. function removeLinkListener()
  40. {
  41.    Tardis.sideMenu.EB.removeListener(this);
  42. }
  43. function txtOver(mc)
  44. {
  45.    var _loc1_ = mc;
  46.    _loc1_.gotoAndStop("over");
  47.    if(blnHasPreview)
  48.    {
  49.       _parent.preview.doOver(_loc1_.num);
  50.    }
  51.    Tardis.sideMenu.doOver(_loc1_.link);
  52. }
  53. function txtOut(mc)
  54. {
  55.    var _loc1_ = mc;
  56.    _loc1_.gotoAndStop("off");
  57.    if(blnHasPreview)
  58.    {
  59.       _parent.preview.doOut(_loc1_.num);
  60.    }
  61.    Tardis.sideMenu.doOut(_loc1_.link);
  62. }
  63. function txtUp(mc)
  64. {
  65.    Tardis.sideMenu.doUp(mc.link);
  66. }
  67. function init()
  68. {
  69.    nodeData = _parent.ndItems.childNodes[this._name.split("_")[2]];
  70.    var strType = nodeData.attributes.type;
  71.    var _loc3_ = strType + "clip" + nodeData.childNodes.length + "MC";
  72.    attachMovie(_loc3_,"mc_module",++depth,{strType:strType});
  73.    mc_module._x = 0;
  74.    mc_module._y = 37;
  75.    var _loc2_ = Tardis.ActiveSection.id;
  76.    var _loc1_ = Tardis.Colors;
  77.    var strColor = _loc1_.getString(_loc2_);
  78.    SECTION_COLOR = _loc1_.getHex(_loc2_);
  79.    DEFAULT_COLOR = _loc1_.getHex("default");
  80.    titleFF.htmlText = nodeData.attributes.title;
  81.    titleFF.textColor = SECTION_COLOR;
  82.    THUMB_PATH = nodeData.attributes.thumbpath;
  83.    play();
  84.    onComplete();
  85. }
  86. function doOver(Item)
  87. {
  88.    var _loc1_ = getMCfromLink(Item);
  89.    _loc1_.gotoAndStop("over");
  90.    _parent.preview.doOver(_loc1_.num);
  91. }
  92. function doOut(Item)
  93. {
  94.    var _loc1_ = getMCfromLink(Item);
  95.    _loc1_.gotoAndStop("off");
  96.    _parent.preview.doOut(_loc1_.num);
  97. }
  98. function positionElements(mc)
  99. {
  100.    var _loc1_ = mc;
  101.    _loc1_.activeBtn._height = _loc1_.imgToCheck._height + _loc1_.titleFF._height + 5;
  102.    _loc1_.titleFF._y = _loc1_.imgToCheck._height;
  103.    _loc1_._visible = true;
  104. }
  105. Links = {};
  106. Tardis.sideMenu.EB.addListener(this);
  107. blnHasPreview = 1;
  108. stop();
  109. onReady();
  110. init();
  111. this.onUnload = function()
  112. {
  113.    removeLinkListener();
  114.    this.onUnload = null;
  115. };
  116.